﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Threading;
using System.Globalization;

public partial class ShowMedia : System.Web.UI.Page
{
    protected override void OnPreInit(EventArgs e)
    {
        base.OnPreInit(e);
        if (Session["user"] == null || string.IsNullOrEmpty(Session["user"].ToString()))
        {
           
           this.MasterPageFile = "~/Dmaster.master";
           
        }
        
    }
    protected override void InitializeCulture()
    {
        base.InitializeCulture();
        if (Session["CurrentCulture"] != null)
        {
            string lang = Session["CurrentCulture"].ToString();
            if (lang != null && lang != "")
            {
                Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang);
                Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(lang);
                System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat = new System.Globalization.CultureInfo("en-US", false).DateTimeFormat;


            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        { 
           if(!string.IsNullOrEmpty(Request.QueryString["id"]))
           {
               DataSet ds = DB.getdata("SELECT [id], [scomment], [link], [mtype] FROM [media] where [id] = " + Request.QueryString["id"]);
               DataRow row = ds.Tables[0].Rows[0];
               MediaControl1.MID = Request.QueryString["id"];
               MediaControl1.LINK = row["link"].ToString();
               MediaControl1.SComment = row["scomment"].ToString();
               MediaControl1.Mtype = int.Parse(row["mtype"].ToString());
               
           }
        
        }
    }
}